import re, os
from website.website_base import WebSiteBase, FetchQueueItem, WebSiteDb
from website.homeweb.homeweb import Homeweb
from bs4 import BeautifulSoup
from lib.log import DBG, INFO, ERROR, EXCEPTION
from lib.sqlite_ext import DBApiExt


class Gblwdz(Homeweb):
    """
    """
    INDEX_URL = "https://www.gblwdz6.wiki"
    cmdpath = os.path.abspath(os.getcwd())
    DB = os.path.join(cmdpath, "website", "gblwdz", "gblwdz.db")
    SAVE_DIR = os.path.join(cmdpath, "website", "gblwdz", "page")

    def __init__(self):
        super().__init__()
    
    @classmethod
    def _class_config(cls):
        """
        获取所有分类首页url列表

        :return:
        """

        class_list = [
            {"name": "国产自拍", "id": "1"},
            {"name": "制服丝袜", "id": "20"},
            {"name": "强奸乱伦", "id": "21"},
            {"name": "人妻熟女", "id": "22"},
            {"name": "主播自拍", "id": "23"},
            {"name": "日韩精品", "id": "24"},
            {"name": "欧美风情", "id": "25"},
            {"name": "卡通动漫", "id": "26"},
            {"name": "经典伦理", "id": "27"}
        ]

        return class_list

    def _parse_class_page_a_list_content(self, soup):
        li_div = soup.select_one(".index-area")
        ul = li_div.find("ul")
        lis = ul.find_all("li")
        return lis


